{% extends 'dashboard.html' %}

{% block main %}
    <h1>新增文章</h1>
    <form class="form-horizontal" method="post" action="" novalidate>
        {% csrf_token %}
        {% for field in form_obj %}
            <div class="form-group">
                <label for="{{ field.id_for_label }}"
                       class="col-sm-2 control-label">{{ field.label }}</label>
                <div class="col-sm-10">
                    {{ field }}{{ field.errors.0 }}
                </div>
            </div>
        {% endfor %}
        <div class="form-group">
            <label for="detail"
                   class="col-sm-2 control-label">文章详情</label>
            <div class="col-sm-10">
                {#                <textarea class="form-control" rows="3" id="detail" name="detail"></textarea>#}
                {{ article_detail_form_obj.content }}
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">保 存</button>
            </div>
        </div>
    </form>

{% endblock %}

{% block js %}
    {% load static %}
    <script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
    <script type="text/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>
{% endblock %}